package com.itheima.redbaby.engine.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.alibaba.fastjson.JSONObject;
import com.itheima.redbaby.ContantValue;
import com.itheima.redbaby.bean.Product;
import com.itheima.redbaby.engine.BaseEngine;
import com.itheima.redbaby.engine.BrandPLlistEngine;

public class BrandPLlistEngineImpl  extends  BaseEngine  implements BrandPLlistEngine{

	@Override
	public List<Product> geBrandPList(String id, int page, int pageNum) {
		//存放请求参数的map
		Map  <String,Object> requestParams  = new HashMap<String, Object>();
		requestParams.put("page", page);//1 2
		requestParams.put("pageNum",pageNum);
		requestParams.put("id", id);
	//获得服务器返回的 json 对象
	 
		JSONObject json = getJson(TYPE_GET, ContantValue.REDBOY_BRANDSERVLERTPLIST, requestParams);
		
		List<Product> topicList = JSONObject.parseArray(json.getString("productlist"), Product.class);
		
		
		
		
		return topicList; 
		  
		
		
		}
	}



